#ifndef TIANYU_WORLD_PROXY_CLIENT_H_
#define TIANYU_WORLD_PROXY_CLIENT_H_

#include "../share/proxy_head.h"
#include "../share/common_define.h"
#include "../share/jsonmessage.h"
#include "../share/common_singleton.h"
#include "../share/server_base.h"
#include "../share/proxy_client.h"
#include "../share/client_base.h"
#include "../share/net_msg_transfer.h"

class CWorldProxyClient 
	:public ::common::CClientBase
	,public ::common::CSingleton< CWorldProxyClient >
{
public:
	CWorldProxyClient();

	~CWorldProxyClient();

	virtual int32_t InitializeServer(int service_type, int service_id);
	virtual int32_t Finalize();

	int32_t SendMsg(common::CProxyHead& proxy_head, const std::string& msg);
	int32_t SendMsgAddHead(common::CProxyHead& proxy_head, const std::string& msg);

	void SendRegisterWorldProxyService();

	//void CheckPingTime( );
public:
	virtual bool on_msg(uint32_t id);
	virtual void OnConnect();

private:
	int 			service_id_;
	int				service_type_;
	CClientNet*		client_net_;
	IService*		service_;
	std::string		ip_;
	uint16_t		port_;
};

#endif



